xend: Cleanup destroy and destroyDomain methods
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 28 Aug 2008 08:44:13 +0000 (09:44 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 28 Aug 2008 08:44:13 +0000 (09:44 +0100)
commit309af15419b92fcc3766dc7060fbe269b6238a54
tree95c52bb3ccaeeacec667fd6a3619da3ea746fea8
parent2e8459a4fcb153bb6f9199a97e85bf17bd2c1b12
xend: Cleanup destroy and destroyDomain methods

When domains are destroyed, _prepare_phantom_paths() method
and _cleanup_phantom_devs() method are called twice as follows.

destroy()@XendDomainInfo.py
    _prepare_phantom_paths() --------------- 1
    _cleanupVm()
    destroyDomain()
        _prepare_phantom_paths() ----------- 2
        xc.domain_destroy_hook()
        xc.domain_pause()
        do_FLR()
        xc.domain_destroy()
        XendDomain.remove_domain()
        cleanupDomain()
        _cleanup_phantom_devs() ------------ 1
    _cleanup_phantom_devs() ---------------- 2
    XendDomain.domain_delete_by_dominfo()

This is a cleanup patch.  It combines destroyDomain() method
into destroy() method, then _prepare_phantom_paths() method and
_cleanup_phantom_devs() method are called only once.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xend/XendDomainInfo.py